package com.food.chain.common.util;

import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class DateUtil {
	
	public final static String LONG_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
	public final static String SHORT_DATE_FORMAT = "yyyy-MM-dd";

	/**
	 * CD-001格式化年月日 格式yyyy-mm-dd
	 * 
	 * @param date
	 * @return
	 */
	public static String dateFormat(String date) {
		// 时间格式化
		String r_date = "";
		SimpleDateFormat df = new SimpleDateFormat(SHORT_DATE_FORMAT);
		try {
			Date date1 = df.parse(date);
			r_date = df.format(date1);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return r_date;
	}

	/**
	 * CD-002格式化日期，格式如2006-07-09 23:00:00
	 * 
	 * @param date
	 *            Date 日期
	 * @return String 输出字符串
	 */
	public static String formatDate2(Date date) {
		if (date == null) {
			return "";
		} else {
			String disp = "";
			SimpleDateFormat bartDateFormat = new SimpleDateFormat(
					LONG_DATE_FORMAT);
			disp = bartDateFormat.format(date);
			return disp;
		}
	}


	/**
	 * CD-003获得当天时间，格式为yyyy-MM-dd HH:mm:ss
	 * 
	 * @return String
	 */
	public static String getNow5() {
		Date d = new Date();
		String str = "";
		SimpleDateFormat formatter = new SimpleDateFormat(LONG_DATE_FORMAT);
		str = formatter.format(d);
		return str;
	}

	/**
	 * CD-004获得前一天的时间
	 * 
	 * @return String
	 */
	public static String getPreviousDate() {
		Calendar cal = Calendar.getInstance();
		cal.add(Calendar.DATE, -1);
		String str = "";
		SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
		str = formatter.format(cal.getTime());
		return str;
	}

	/**
	 * CD-005获得当前月份
	 * 
	 * @return String 格式：2007-05
	 */
	public static String getMonth2() {
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
		String strDate = dateFormat.format(new Date());
		return strDate;
	}

	/**
	 * CD-006获得该月的第一天日期和最后一天日期
	 * 
	 * @param year
	 *            int 年份
	 * @param month
	 *            int 月份
	 * @return String[]
	 */
	public static String[] getMonth(int year, int month) {
		SimpleDateFormat format = new SimpleDateFormat(SHORT_DATE_FORMAT);
		String[] dates = new String[2];
		Calendar startCal = Calendar.getInstance();
		startCal.set(year, month - 1, 1);
		dates[0] = format.format(startCal.getTime());

		Calendar endCal = Calendar.getInstance();
		endCal.set(year, month, 1);
		endCal.add(Calendar.DATE, -1);
		dates[1] = format.format(endCal.getTime());
		return dates;
	}

	/**
	 * CD-007获得前一天的日期
	 * 
	 * @return 返回前一天日期的字符串变量，如"20030711"
	 */
	public static String getlastDate() {
		Calendar cal = Calendar.getInstance();
		cal.add(Calendar.DATE, -1);
		String str = "";
		SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
		str = formatter.format(cal.getTime());
		return str;
	}


	/**
	 * CD-008 获得两个日期之间的天数日期格式为yyyy-MM-dd
	 * 
	 * @param startTime
	 *            起始日期
	 * @param endTime
	 *            结束日期
	 * @return int
	 */
	public static int getDateFromTime1ToTime2(String startTime, String endTime) {
		SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
		Date dt1 = null;
		Date dt2 = null;
		int checkDays = 0;
		try {
			dt1 = formatter.parse(endTime);
			dt2 = formatter.parse(startTime);
			long l = dt1.getTime() - dt2.getTime();
			l = (long) (l / (1000 * 60 * 60 * 24) + 0.5);
			checkDays = Integer.parseInt(String.valueOf(l));
		} catch (ParseException e) {
			return checkDays;
		}
		return checkDays;
	}

	/**
	 * CD-009 将日期转换为毫秒:
	 * @param date
	 * @param pattern
	 * @return
	 */
	public static long date2millisecond(String date, String pattern) {
		// 传入的参数要与yyyyMMddHH的格式相同 "yyyyMMddHH"
		SimpleDateFormat simpledateformat = new SimpleDateFormat(pattern,
				Locale.SIMPLIFIED_CHINESE);
		Date date2 = null;
		try {
			date2 = simpledateformat.parse(date);// 将参数按照给定的格式解析参数
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return date2.getTime();
	}
	/**
	 * CD-010日期加减
	 * 
	 * @param inday
	 *            输入的时间
	 * @param offset
	 *            日期间隔天数
	 * @return 日期（yyyy-MM-dd）
	 */
	public static String changeByDay(String inday, int offset) {
		Calendar calendar = Calendar.getInstance();
		Date date = strToDate(inday);
		calendar.setTime(date);
		calendar.set(Calendar.DAY_OF_YEAR,
				(calendar.get(Calendar.DAY_OF_YEAR) + offset));
		SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
		String day = formatter.format(calendar.getTime());
		return day;
	}

	/**
	 * CD-011 日期转换 把String 类型转换为date类型
	 * 
	 * @param inday
	 *            输入的时间
	 * @param offset
	 *            日期间隔天数
	 * @return 日期（yyyy-MM-dd）
	 */

	public static Date strToDate(String strDate) {
		if(!"".equals(strDate)){
			SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
			ParsePosition pos = new ParsePosition(0);
			Date strtodate = formatter.parse(strDate, pos);
			return strtodate;
		}
		return null;
	}
	
	public static Date strToDate(String strDate, String dateFormat) {
		
		Date date = null;
		
		if(strDate != null && !"".equals(strDate)){
			SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
			try {
				date = formatter.parse(strDate);
			} catch (ParseException e) {
				date = null;
			}
		}
			
		return date;
	}

	/**
	 * CD-012 获取本月的第一天，格式为yyyy-MM-dd
	 * 
	 * @return 从现在到上周的时间字符串
	 */
	public static String getfirstDayOfMonth() {
		Calendar ca = Calendar.getInstance();
		SimpleDateFormat sdf = new SimpleDateFormat(SHORT_DATE_FORMAT);
		ca.set(Calendar.DAY_OF_MONTH, 1);
		Date da = ca.getTime();
		return sdf.format(da);
	}

	/**
	 * CD-013 年加减
	 * 
	 * @param sDate
	 *            输入的时间
	 * @param offset
	 *            日期间隔月数
	 * @return 日期（yyyy-MM-dd）
	 */
	@SuppressWarnings("static-access")
	public static String getNYearBeforeOneDay(String sDate, int offset) {
		Calendar calendar = Calendar.getInstance();
		Date date = strToDate(sDate);
		calendar.setTime(date);
		calendar.add(calendar.YEAR, offset);
		SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
		String day = formatter.format(calendar.getTime());
		return day;

	}

	/**
	 * CD-014 获得本月的最后一天
	 * 
	 * @return String
	 */
	public static String getLastMonthDay(String sDate) {
		SimpleDateFormat format = new SimpleDateFormat(SHORT_DATE_FORMAT);
		Date d = strToDate(sDate);
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(d);
		calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
				1);
		// calendar.add(Calendar.DATE, -1);
		calendar.add(Calendar.MONTH, 1);
		calendar.add(Calendar.DATE, -1);
		String date = format.format(calendar.getTime());
		// date = getNMonthBeforeOneDay(date,1);
		return date;
	}

	/**
	 * 
	 * CD-015 得到指定月的天数
	 * 
	 * */

	public static int getMonthLastDay(int year, int month) {
		Calendar a = Calendar.getInstance();
		a.set(Calendar.YEAR, year);
		a.set(Calendar.MONTH, month - 1);
		a.set(Calendar.DATE, 1);// 把日期设置为当月第一天
		a.roll(Calendar.DATE, -1);// 日期回滚一天，也就是最后一天
		int maxDate = a.get(Calendar.DATE);
		return maxDate;
	}
	
	/**
	 * 获取当前时间,格式为yyyyMMddHHmmss
	 * @return
	 */
	public static String getNow1() {
		Date now = new Date(); 
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
		return dateFormat.format(now); 
	}
	
	/**
	 * 获取当前日期
	 * @param dateFormat
	 * @return
	 */
	public static String getNow(String dateFormat) {
		Date now = new Date(); 
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
		return simpleDateFormat.format(now); 
	}
	
	/**
	 * 获得当天日期，格式为yyyy-MM-dd
	 * 
	 * @return String
	 */
	public static String getNow4() {
		Date d = new Date();
		String str = "";
		SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
		str = formatter.format(d);
		return str;
	}
	
	/**
	 * 获得当天日期，格式为yyyyMMdd
	 * 
	 * @return String
	 */
	public static String getNowYMD() {
		Date d = new Date();
		String str = "";
		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
		str = formatter.format(d);
		return str;
	}
	
	/**
	 * HH:mm 转成当天 yyyy-MM-dd HH:mm:ss
	 * 
	 * @return String
	 */
	public static String timeToDateTime(String time) {
		String str = "";
		if(!time.equals("")){
			Date d = new Date();
			SimpleDateFormat formatter = new SimpleDateFormat(SHORT_DATE_FORMAT);
			str = formatter.format(d)+" "+time+":00";
		}
		return str;
	}
	
	/**
	 * 返回两个时间戳之间的分钟差("yyyy-MM-dd HH:mm:ss")
	 * 
	 * @return String
	 */
	public static double minDiff(String startTime, String endTime) {   
        SimpleDateFormat sd = new SimpleDateFormat(LONG_DATE_FORMAT);    
//        long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数    
//        long nh = 1000 * 60 * 60;// 一小时的毫秒数    
        double nm = 1000 * 60;// 一分钟的毫秒数    
//        long ns = 1000;// 一秒钟的毫秒数    
        double diff;    
//        long day = 0;    
//        long hour = 0;    
        double min = 0;    
//        long sec = 0;    
        // 获得两个时间的毫秒时间差异    
        try {    
            diff = sd.parse(endTime).getTime() - sd.parse(startTime).getTime();    
//            day = diff / nd;// 计算差多少天    
//            hour = diff % nd / nh + day * 24;// 计算差多少小时    
//            min = diff % nd % nh / nm + day * 24 * 60;// 计算差多少分钟    
//            sec = diff % nd % nh % nm / ns;// 计算差多少秒    
            min = diff / nm;
            return min;
        } catch (ParseException e) {    
            e.printStackTrace();    
        }
        return min;
	}
	
	/**
	 * 返回两个时间戳之间的分钟差("HH:mm")
	 * 
	 * @return String
	 */
	public static double minDiff1(String startTime, String endTime) {
		startTime = "2016-01-01 " + startTime + ":00";
		endTime   = "2016-01-01 " + endTime + ":00";
        SimpleDateFormat sd = new SimpleDateFormat(LONG_DATE_FORMAT);
        double nm = 1000 * 60;// 一分钟的毫秒数 
        double diff;
        double min = 0;
   
        // 获得两个时间的毫秒时间差异
        try {
            diff = sd.parse(endTime).getTime() - sd.parse(startTime).getTime();
            min = diff / nm;
            return min;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return min;
	}
	
	
	/**
	 * 根据起始日和终止日计算周数
	 * 
	 * @return String
	 * @throws ParseException 
	 */
	public static int computeWeek(String sDay, String eDay) throws ParseException { 

        int wks = 0;  
        
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
		Date sdate = format.parse(sDay);
		Date edate = format.parse(eDay);

        Calendar sCalendar = Calendar.getInstance(); 
        sCalendar.setTime(sdate);  

        Calendar eCalendar = Calendar.getInstance(); 
        eCalendar.setTime(edate); 
        
        if(sCalendar.before(eCalendar) && sCalendar.get(Calendar.DAY_OF_WEEK)-1 != 1){//已开学，并且开始日不是周一
        	if(sCalendar.get(Calendar.DAY_OF_WEEK) == 1){//周日
        		sCalendar.add(Calendar.DAY_OF_YEAR, 1); 
        	}else{
        		sCalendar.add(Calendar.DAY_OF_YEAR, 7-sCalendar.get(Calendar.DAY_OF_WEEK)+2); 
        	}
            wks += 1;
        }

        while (sCalendar.before(eCalendar) || sCalendar.equals(eCalendar)) {  
//            if (sCalendar.get(Calendar.YEAR) == eCalendar.get(Calendar.YEAR) &&
//            	sCalendar.get(Calendar.MONTH) == eCalendar.get(Calendar.MONTH) &&
//            	sCalendar.get(Calendar.DAY_OF_WEEK_IN_MONTH) == eCalendar.get(Calendar.DAY_OF_WEEK_IN_MONTH)) { 
//                break;  
//            } else {  
                sCalendar.add(Calendar.DAY_OF_YEAR, 7); 
                wks += 1;
//            } 
        } 
//        if(sdate.before(edate)){
//        	wks += 1; //此函数其实是计算两个日期之间间隔多少周，因此计算出来的周数还要加1才是当前实际周数。
//        }
        
//        if(sDay.equals(eDay)){
//        	wks = 1;
//        }
        
        return wks; 
    }
	
	
	 public static String getFirstDayOfWeek(int year, int week) {
		  
		  Calendar firDay = Calendar.getInstance();
		  // 先滚动到该年
		  firDay.set(Calendar.YEAR, year);
		  // 滚动到周
		  firDay.set(Calendar.WEEK_OF_YEAR, week + 1);
		  // 得到该周第一天
		  firDay.set(Calendar.DAY_OF_WEEK, 2);
		  
		  SimpleDateFormat sdf = new SimpleDateFormat(SHORT_DATE_FORMAT);
		  String firstDay = sdf.format(firDay.getTime());
		  return firstDay;
	}
		 
	public static String getLastDayOfWeek(int year, int week){
		  
		  Calendar lasDay = Calendar.getInstance();
		  // 先滚动到该年
		  lasDay.set(Calendar.YEAR, year);
		  // 滚动到周
		  lasDay.set(Calendar.WEEK_OF_YEAR, week + 1);
		  // 得到该周第一天
		  lasDay.set(Calendar.DAY_OF_WEEK, 2);
		  // 得到该周最后一天
		  lasDay.add(Calendar.DAY_OF_WEEK, 6);
		  
		  SimpleDateFormat sdf = new SimpleDateFormat(SHORT_DATE_FORMAT);
		  String lastDay = sdf.format(lasDay.getTime());
		  return lastDay;
	}
	
	
	/**
	 * 得到本周周一
	 * 
	 * @return yyyy-MM-dd
	 */
	public static String getMondayOfThisWeek() {
		SimpleDateFormat df = new SimpleDateFormat(SHORT_DATE_FORMAT);
		Calendar c = Calendar.getInstance();
		int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
		if (day_of_week == 0)
			day_of_week = 7;
		c.add(Calendar.DATE, -day_of_week + 1);
		return df.format(c.getTime());
	}
	 
	/**
	 * 得到本周周日
	 * 
	 * @return yyyy-MM-dd
	 */
	public static String getSundayOfThisWeek() {
		SimpleDateFormat df = new SimpleDateFormat(SHORT_DATE_FORMAT);
		Calendar c = Calendar.getInstance();
		int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
		if (day_of_week == 0)
			day_of_week = 7;
		c.add(Calendar.DATE, -day_of_week + 7);
		return df.format(c.getTime());
	}
	
	/**
	 * 计算今天之前n天的日期
	 * @param offset
	 * @return MM/dd
	 */
	public static String offTodayDay(int offset) {
		Calendar calendar = Calendar.getInstance();
		Date date = new Date();
		calendar.setTime(date);
		calendar.set(Calendar.DAY_OF_YEAR, (calendar.get(Calendar.DAY_OF_YEAR) - offset));
		SimpleDateFormat formatter = new SimpleDateFormat("MM/dd");
		String day = formatter.format(calendar.getTime());
		return day;
	}
	
	
	/** 
     * 根据日期计算所在周的周一
     * @param time 指定的日期 
	 * @throws ParseException 
     */  
	public static String getMondayByDate(String sDay) throws ParseException {  
    	
    	SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
		Date time = format.parse(sDay);

        Calendar cal = Calendar.getInstance();  
        cal.setTime(time);  
        
        //判断要计算的日期是否是周日，如果是则减一天计算周六的，否则会出问题，计算到下一周去了  
        int dayWeek = cal.get(Calendar.DAY_OF_WEEK);//获得当前日期是一个星期的第几天  
        if(1 == dayWeek) {  
            cal.add(Calendar.DAY_OF_MONTH, -1);  
        }  

        cal.setFirstDayOfWeek(Calendar.MONDAY);//设置一个星期的第一天，按中国的习惯一个星期的第一天是星期一  
        int day = cal.get(Calendar.DAY_OF_WEEK);//获得当前日期是一个星期的第几天  
        cal.add(Calendar.DATE, cal.getFirstDayOfWeek()-day);//根据日历的规则，给当前日期减去星期几与一个星期第一天的差值   
        
        SimpleDateFormat sdf = new SimpleDateFormat(SHORT_DATE_FORMAT); //设置时间格式  
        String imptimeBegin = sdf.format(cal.getTime());  
        
        return imptimeBegin;
    }
    
	/** 
     * 根据日期计算所在周的周日 
     * @param time 指定的日期 
	 * @throws ParseException 
     */  
	public static String getSundayByDate(String sDay) throws ParseException {  
    	
    	SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
		Date time = format.parse(sDay);
  
        SimpleDateFormat sdf = new SimpleDateFormat(SHORT_DATE_FORMAT); //设置时间格式  
        Calendar cal = Calendar.getInstance();  
        cal.setTime(time);  
        //判断要计算的日期是否是周日，如果是则减一天计算周六的，否则会出问题，计算到下一周去了  
        int dayWeek = cal.get(Calendar.DAY_OF_WEEK);//获得当前日期是一个星期的第几天  
        if(1 == dayWeek) {  
            cal.add(Calendar.DAY_OF_MONTH, -1);  
        }  

        cal.setFirstDayOfWeek(Calendar.MONDAY);//设置一个星期的第一天，按中国的习惯一个星期的第一天是星期一  
        int day = cal.get(Calendar.DAY_OF_WEEK);//获得当前日期是一个星期的第几天  
        cal.add(Calendar.DATE, cal.getFirstDayOfWeek()-day);//根据日历的规则，给当前日期减去星期几与一个星期第一天的差值   
        cal.add(Calendar.DATE, 6);  
        String imptimeEnd = sdf.format(cal.getTime());  
        
        return imptimeEnd;
    }
	

	/**
	 * 根据日期计算所在周的周六
	 * @param days 指定的日期 
	 * @param week 指定要加的周数
	 * @return 
	 * @throws ParseException
	 */
	public static String getRYLastDayOfWeek(String days, int week) throws ParseException {
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
		Date time = format.parse(days);
		SimpleDateFormat sdf = new SimpleDateFormat(SHORT_DATE_FORMAT);
        Calendar cal = Calendar.getInstance();  
        
        cal.setTime(time);
        cal.add(Calendar.WEEK_OF_MONTH, week);
        // 设置星期天为本周的第一天
        cal.setFirstDayOfWeek(Calendar.SUNDAY);
        // 最后一天为周六
        cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek() + 6); 
        
        // 获取 本周的最后一天
		return sdf.format(cal.getTime());
	}
	
	/**
	 * 根据日期计算所在周的周日
	 * @param days 指定的日期 
	 * @param week 指定要加的周数
	 * @throws ParseException
	 */
	public static String getRYFirstDayOfWeek(String days, int week) throws ParseException {
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
		Date time = format.parse(days);
		SimpleDateFormat sdf = new SimpleDateFormat(SHORT_DATE_FORMAT);
        Calendar cal = Calendar.getInstance();  
        
        cal.setTime(time);
        cal.add(Calendar.WEEK_OF_MONTH, week);
        // 设置星期天为本周的第一天
        cal.setFirstDayOfWeek(Calendar.SUNDAY);
        // 第一天
        cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek()); 
        
        // 获取 本周的第一天
        return sdf.format(cal.getTime());
	}
	
	/**
	 * 计算两个日期间的星期数
	 * @param start： yyyyMMdd格式的时间
	 * @param end： yyyyMMdd格式的时间
	 * @param flg： 0：每周第一天是周日 1：每周第一天是周一
	 * @return
	 * @throws Exception
	 */
	public static int computeWeeksBetween2Days(String start, String end, int flg) throws Exception {
		int wks = 0;  
        
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
		Date sdate = null ,edate = null;
		sdate = format.parse(start);
		edate = format.parse(end);

        Calendar sCalendar = Calendar.getInstance(); 
        sCalendar.setTime(sdate);  
        if (flg == 0) {
        	sCalendar.setFirstDayOfWeek(Calendar.SUNDAY);
        	sCalendar.set(Calendar.DAY_OF_WEEK, sCalendar.getFirstDayOfWeek()); 
		}
        else if (flg == 1) {
        	int day = sCalendar.get(Calendar.DAY_OF_WEEK);
        	// 如果指定日期是星期天
        	if (day == Calendar.SUNDAY) {
        		sCalendar.add(Calendar.DAY_OF_MONTH, -1);
        	}
        	// 设定一周的开始为星期一
        	sCalendar.setFirstDayOfWeek(Calendar.MONDAY);
        	day = sCalendar.get(Calendar.DAY_OF_WEEK);
        	// 获取每周的第一天
        	sCalendar.add(Calendar.DATE, -day + sCalendar.getFirstDayOfWeek());
		}
        
        
        Calendar eCalendar = Calendar.getInstance(); 
        eCalendar.setTime(edate); 
        if (flg == 0) {
        	eCalendar.setFirstDayOfWeek(Calendar.SUNDAY);
        	eCalendar.set(Calendar.DAY_OF_WEEK, eCalendar.getFirstDayOfWeek()); 
		}
        else if (flg == 1) {
        	int day = eCalendar.get(Calendar.DAY_OF_WEEK);
        	// 如果指定日期是星期天
        	if (day == Calendar.SUNDAY) {
        		eCalendar.add(Calendar.DAY_OF_MONTH, -1);
        	}
        	// 设定一周的开始为星期一
        	eCalendar.setFirstDayOfWeek(Calendar.MONDAY);
        	day = eCalendar.get(Calendar.DAY_OF_WEEK);
        	// 获取每周的第一天
        	eCalendar.add(Calendar.DATE, -day + eCalendar.getFirstDayOfWeek());
		}
        
        
        // eCalendar > = sCalendar
        while (eCalendar.compareTo(sCalendar) >= 0) {
        	wks++;
        	sCalendar.add(Calendar.WEEK_OF_YEAR, 1);
		}
        
        return wks;
	}
}
